cmake_minimum_required(VERSION 3.15)
project(SuperMatrix)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
if(${CMAKE_BUILD_TYPE} MATCHES "Debug")
  set(CMAKE_CXX_FLAGS "-g -Wall")
elseif(${CMAKE_BUILD_TYPE} MATCHES "Release")
  set(CMAKE_CXX_FLAGS "-O3 -Wall")
endif()

message(STATUS "Build Target ${BUILD_DEVICE}")
add_subdirectory(Thrift)
add_subdirectory(Broadcast)
add_subdirectory(BufferIPC)
if((${BUILD_DEVICE} MATCHES "Client") OR (NOT DEFINED BUILD_DEVICE))
  message(STATUS "Build Client Target")
  add_subdirectory(Client)
  add_subdirectory(OldClient)
  add_subdirectory(VideoStream)
endif()
if(${BUILD_DEVICE} MATCHES "StandAlone")
  message(STATUS "Build StandAlone Target")
  add_subdirectory(Client)
  add_subdirectory(Stand-Alone)
endif()
if(${ALGO_CCD} MATCHES "Enable")
  message(STATUS "Enable Algorithm CCD")
  add_subdirectory(Algorithm/CCD)
endif()
if(NOT DEFINED BUILD_DEVICE)
  message(STATUS "Build documentation Target")
  add_subdirectory(DeviceNetwork)
  add_subdirectory(NodeControl)
  include(docs/build_doxygen.cmake)
  build_doxygen()
endif()
